
<?php 
echo $this->assign('title', 'Administraci&oacute;n de Productos');
echo $this->Form->create('Linea', array('action' => 'edit', 'class' => 'well'));
?>

<legend>Editar Producto</legend>

<div class="accordion" id="accordion2">
	<div class="accordion-group">
		<div class="accordion-heading">
			<a class="accordion-toggle" data-toggle="collapse" href="#collapseOne">
				Datos
			</a>
		</div>
		<div id="collapseOne" class="accordion-body collapse in">
			<div class="accordion-inner">
				<div style="float:left; margin-left:30px">

<?php
echo $this->Form->input('nombre');
echo $this->Form->input('descripcion');

echo $this->Form->input('m_id', array('label' => 'Marcas', 'empty' => 'Seleccionar'));
echo $this->Form->input('destacado');
echo $this->Form->input('id', array('type' => 'hidden'));
?>
			
				</div>
				<div >
					<ul class="thumbnails">
					  <li class="span3" style="float:right; margin-right:30px">
						<a href="#" class="thumbnail">
							<?php echo $this->Html->image($this->request->data['Producto']['imagen'], array('alt' => $this->request->data['Producto']['nombre'])); ?>
						</a>
					  </li>
					 </ul>
				</div>
			</div>
		</div>
	</div>
	<div class="accordion-group">
		<div class="accordion-heading">
			<a class="accordion-toggle" data-toggle="collapse" href="#collapseTwo">
				Rubros
			</a>
		</div>
		<div id="collapseTwo" class="accordion-body collapse">
			<div class="accordion-inner">
		
				<div id= "tablaRubros">

				<?php echo $this->Ajax->link('Ver Rubros', array('controller' => 'productos', 'action' => 'updateRubro', 2, $this->request->data['Producto']['id']), array( 'update' => 'tablaRubros')); ?>

				</div>
			</div>
		</div>
	</div>
	<div class="accordion-group">
		<div class="accordion-heading">
			<a class="accordion-toggle" data-toggle="collapse" href="#collapseThree">Lineas</a>
		</div>
		<div id="collapseThree" class="accordion-body collapse">
			<div class="accordion-inner">
	
				<div id= "tablaLineas">

					<?php echo $this->Ajax->link('Ver Lineas', array('controller' => 'productos', 'action' => 'updateLinea', 2, $this->request->data['Producto']['id']), array( 'update' => 'tablaLineas')); ?>

				</div>
			</div>
		</div>
	</div>
	<div class="accordion-group">
		<div class="accordion-heading">
			<a class="accordion-toggle" data-toggle="collapse" href="#collapseFour">Imagenes</a>
		</div>
		<div id="collapseFour" class="accordion-body collapse">
			<div class="accordion-inner">
	
				<div id= "img">					
					<ul class="thumbnails">
					  <li class="span3" style="float:none; margin:auto">
						<div class="thumbnail">
								<h5>Imagen cargada</h5>
							<?php echo $this->Html->image($this->request->data['Producto']['imagen'], array('alt' => $this->request->data['Producto']['nombre'])); ?>
								<p>	<?php echo $this->Form->file('Producto.imagen'); ?> </p>
						</div>
						</li>						
					</ul>
					<?php if ($this->request->data['Producto']['destacado']) { ?>
					<ul class="thumbnails">
					  <li class="span10" style="float:none; margin:auto">
						<div class="thumbnail">
								<h5>Imagen destacado cargada</h5>
							<?php echo $this->Html->image($this->request->data['Producto']['imagendestacada'], array('alt' => $this->request->data['Producto']['nombre'])); ?>
								<p>	<?php echo $this->Form->file('Producto.imagendestacada'); ?> </p>
						</div>
						</li>
						<?php } ?>
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="btn-toolbar">
	<div class="btn-group">
<?php 
echo $this->Form->submit('Guardar', array('class' => 'btn btn-primary', 'div' => false));
echo '</div>';
echo '<div class="btn-group">';
echo $this->Html->link('Cancelar', array('action' => 'index'), array('class' => 'btn'));
echo '</div>';
echo '</div>';
echo $this->Form->end();
?>

